from monulu.raid.models import Instance, Boss, Item, Raid, CharacterClass, Character, Raider, RaidLoot
from django.contrib import admin

class RaiderInline(admin.TabularInline):
    model = Raider
    extra = 2 

class RaidLootInline(admin.TabularInline):
    model = RaidLoot
    extra = 1

class RaidAdmin(admin.ModelAdmin):
    inlines = [RaiderInline, RaidLootInline]
    list_display = ('instance','characters_required','signups','start_time', 'ends')

class BossItemAdmin(admin.TabularInline):
    model = Item
    extra = 1
    
class BossAdmin(admin.ModelAdmin):
    inlines = [BossItemAdmin,]
    list_display = ('instance','name')

class CharacterAdmin(admin.ModelAdmin):
    list_display = ('name','character_class')

class CharacterClassAdmin(admin.ModelAdmin):
    list_display = ('name','hex_colour')
    
class ItemAdmin(admin.ModelAdmin):
    list_display = ('name','boss','instance')

admin.site.register(Instance)
admin.site.register(Boss, BossAdmin)
admin.site.register(Item, ItemAdmin)
admin.site.register(Raid, RaidAdmin)
admin.site.register(CharacterClass, CharacterClassAdmin)
admin.site.register(Character, CharacterAdmin)

